/*
 * QWindowsClassicStyle.h  0.4.0 / Nov 17, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef QWINDOWSCLASSICSTYLE_H
#define QWINDOWSCLASSICSTYLE_H

#include <QWindowsStyle>

// QWindowsClassicStyle Class. -------------------------------------------------

/*!
 * \brief Classic Windows Style.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class QWindowsClassicStyle : public QWindowsStyle
{
  Q_OBJECT
public:
  QWindowsClassicStyle();
public:
  bool isPatchEnabled();
  void setPatchEnabled(bool enabled);
public:
  virtual int pixelMetric(PixelMetric metric, const QStyleOption *option,
                          const QWidget *widget) const;
  virtual void drawPrimitive(PrimitiveElement element,
                             const QStyleOption *option, QPainter *painter,
                             const QWidget *widget) const;
  virtual void drawComplexControl(ComplexControl control,
                                  const QStyleOptionComplex *option,
                                  QPainter *painter,
                                  const QWidget *widget) const;
  virtual int styleHint(StyleHint hint, const QStyleOption *option = 0,
                        const QWidget *widget = 0,
                        QStyleHintReturn *returnData = 0) const;
  virtual QRect subElementRect(SubElement sr, const QStyleOption *opt,
                               const QWidget *widget) const;
  virtual QPalette standardPalette() const;
private:
  bool m_patchDisabled;
  mutable QColor m_leftTitleBarColor;
  mutable QColor m_rightTitleBarColor;
  mutable QColor m_leftTitleBarInactiveColor;
  mutable QColor m_rightTitleBarInactiveColor;
};

// QWindowsClassicStyle :: Public Inline Member Functions. ---------------------

/**
 * \brief Returns \c true if using the patch.
 *
 * \return \c true if using the patch
 */
inline bool QWindowsClassicStyle::isPatchEnabled()
{
  return !m_patchDisabled;
}

/*!
 * \brief Sets wheter or not applying the patch.
 *
 * \param enabled \c true if applying
 */
inline void QWindowsClassicStyle::setPatchEnabled(bool enabled)
{
  m_patchDisabled = !enabled;
}

#endif // QWINDOWSCLASSICSTYLE_H
